Skip to content

fix(csharp): resolve rc.21 review blockers for the 1.3.0 release - #599

Merged
dmealing merged 3 commits into
mainfrom
fm/mo-rc19-review-blockers
Nov 18, 2026
Merged

dmealing merged 3 commits into
mainfrom
fm/mo-rc19-review-blockers

Conversation

@dmealing

@dmealing dmealing commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Credential stripping now resolves the { rows, total } envelope's rows key from the serializer's own contract instead of the literal "rows", via a single SerializerKeys.StripBody helper used by both the generated routes and ReportExportHttp — failing closed (refusing the response) when the key is unreadable or the node is not an array. Fixes the credential leak under SnakeCaseUpper/KebabCaseUpper hosts with PropertyNameCaseInsensitive=false, now covered by live host-variant and unit tests plus re-captured golden routes.
  • A narrowed EntityGenerator entry declares a shared enum itself unless another entry in the same run (via ctx.Generators) accepts the enum's home object, so a single narrowed entry compiles on its own (fixes the CS0234 build break) while multi-entry runs still declare it exactly once. Also in C#: the ?sort= allowlist accepts both the metadata field name and the resolved C# property name when a rename goes beyond case (emitting an OrdinalIgnoreCase dictionary only then), and the sized @dbColumnType regex ends in \z so "varchar(10)\n" is refused.
  • Registered implementedIn: ["typescript","csharp"] on the five rc.21 view-vocabulary entries (origin.function, @union, @unionAll, @grain, @grainOrdinal) in spec/metamodel — the canonical source — with the C#/Python byte copies, TS embeds, expected-registry.json and metamodel-docs fixtures regenerated from it; corrected the existing [1.3.0] CHANGELOG entries to name exactly what the credential strip removes, the G2 and sort behavior, and the computed-field ERR_INVALID_ORIGIN line. No version bump.
Validation

Risk Assessment

✅ Low: The two blocker fixes are tight and fail-closed (B1 refuses rather than sends unstripped; B2's declaring-is-default compiles standalone and declares exactly once per run), the vocabulary edit is metadata-only and byte-consistent across ports, and the sort-allowlist change is byte-identical without renames — no reachable defect, leak path, or intent contradiction found.

Testing

Drove the two release blockers end-to-end at the real product surface: the credential-stripping fix was exercised over live HTTP on generated ASP.NET routes against disposable Testcontainers Postgres under the previously-leaking strict upper-case serializer hosts (all 12 variants pass, including the fail-closed refusal guards), and the shared-enum fix was exercised by running the real C# EntityGenerator narrowed and compiling its emitted output with Roslyn (compiles standalone; declared exactly once across a run's entries). The L2/L6/L7 supporting findings passed their focused suites (renamed sort allowlist golden contract, StripBody under real System.Text.Json options, loader and regex behavior). No source or test files were changed, so the already-passing configured regression run stands. No UI surface exists in this change, so no visual evidence was applicable.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
B1: GET/POST/PATCH/PUT on generated routes under a strict SnakeCaseUpper (and KebabCaseUpper) host — PropertyNameCaseInsensitive=false, envelope key serialized as ROWS — returns no credential under an… ✅ pass live dotnet test MetaObjects.IntegrationTests --filter FullyQualifiedName~ApiContractCredentialHostVariantsTest — 12/12 passed, incl. (naming:plain, policy:snakeUpper), (naming:rename, policy:kebabUpper)…
B1 adversarial (fail-closed): a host whose serializer contract for the envelope cannot be read refuses the response instead of sending it unstripped ✅ pass live Same run: A_host_whose_contract_cannot_be_read_refuses_to_start_instead_of_leaking_the_account_credential and ..._the_subtype_credential both passed; StripBody's throw paths for a missing rows pro…
B2: a single narrowed EntityGenerator entry (Include = Order only, shared enum homed at Customer) emits C# that compiles on its own (no CS0234), while three entries of one run still declare the shared… ✅ pass live GeneratorIncludeTests.A_single_narrowed_entry_declares_a_shared_enum_whose_home_it_does_not_emit(listed:True/False) compiles the emitted files via Roslyn (PackageNamespaceTests.CompileErrors, 0 er…
L2/L6/L7 supporting findings: with a property rename beyond case the ?sort= allowlist accepts both the metadata field name and the resolved property (generated golden contract + live StripBody behavio… ✅ pass live PropertyNamingEmitSitesTests + SerializerKeysTests (25/25) and R6Plan2LoaderTests (15/15) — the sort-allowlist assertions run against the generator's emitted golden files (an intentional generat…
Evidence: B1 live run: credential host-variants over HTTP (Testcontainers PG) — full log incl. container lifecycle and 12/12 pass summary

Passed MetaObjects.IntegrationTests.Api.ApiContractCredentialHostVariantsTest.A_credential_is_never_returned_and_never_written_whatever_the_host_does_to_keys(naming: "plain", policy: "snakeUpper") Passed ...A_credential_is_never_returned_and_never_written_whatever_the_host_does_to_keys(naming: "rename", policy: "kebabUpper") Passed ...A_subtype_credential_is_never_returned_or_written_on_the_polymorphic_and_subtype_routes(naming: "plain", policy: "snakeUpper") Passed ...A_subtype_credential_is_never_returned_or_written_on_the_polymorphic_and_subtype_routes(naming: "rename", policy: "kebabUpper") Passed ...A_host_whose_contract_cannot_be_read_refuses_to_start_instead_of_leaking_the_account_credential Passed ...A_host_whose_contract_cannot_be_read_refuses_to_start_instead_of_leaking_the_subtype_credential Passed! - Failed: 0, Passed: 12, Skipped: 0, Total: 12

  Determining projects to restore...
  Restored {run-worktree}/server/csharp/MetaObjects.IntegrationTests/MetaObjects.IntegrationTests.csproj (in 223 ms).
  3 of 4 projects are up-to-date for restore.
  MetaObjects -> {run-worktree}/server/csharp/MetaObjects/bin/Debug/net8.0/MetaObjects.dll
  MetaObjects.Render -> {run-worktree}/server/csharp/MetaObjects.Render/bin/Debug/net8.0/MetaObjects.Render.dll
  MetaObjects.Codegen -> {run-worktree}/server/csharp/MetaObjects.Codegen/bin/Debug/net8.0/MetaObjects.Codegen.dll
  MetaObjects.IntegrationTests -> {run-worktree}/server/csharp/MetaObjects.IntegrationTests/bin/Debug/net8.0/MetaObjects.IntegrationTests.dll
Test run for {run-worktree}/server/csharp/MetaObjects.IntegrationTests/bin/Debug/net8.0/MetaObjects.IntegrationTests.dll (.NETCoreApp,Version=v8.0)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[testcontainers.org 00:00:00.06] Connected to Docker:
  Host: unix:///var/run/docker.sock
  Server Version: 29.1.3
  Kernel Version: 7.2.15-76070215-generic
  API Version: 1.52
  Operating System: Pop!_OS 22.04 LTS
  Total Memory: 60.40 GB
[testcontainers.org 00:00:00.19] Docker container 4e45f3b9eb3f created
[testcontainers.org 00:00:00.21] Start Docker container 4e45f3b9eb3f
[testcontainers.org 00:00:00.33] Wait for Docker container 4e45f3b9eb3f to complete readiness checks
[testcontainers.org 00:00:01.34] Docker container 4e45f3b9eb3f ready
[testcontainers.org 00:00:01.43] Docker container 664370bfd692 created
[testcontainers.org 00:00:01.43] Start Docker container 664370bfd692
[testcontainers.org 00:00:01.57] Wait for Docker container 664370bfd692 to complete readiness checks
[testcontainers.org 00:00:01.58] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 664370bfd692
[testcontainers.org 00:00:02.61] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 664370bfd692
[testcontainers.org 00:00:02.65] Docker container 664370bfd692 ready
[testcontainers.org 00:00:04.45] Delete Docker container 664370bfd692
[testcontainers.org 00:00:04.69] Docker container 248c4e201c9e created
[testcontainers.org 00:00:04.69] Start Docker container 248c4e201c9e
[testcontainers.org 00:00:04.80] Wait for Docker container 248c4e201c9e to complete readiness checks
[testcontainers.org 00:00:04.80] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 248c4e201c9e
[testcontainers.org 00:00:05.83] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 248c4e201c9e
[testcontainers.org 00:00:05.86] Docker container 248c4e201c9e ready
[testcontainers.org 00:00:06.27] Delete Docker container 248c4e201c9e
[testcontainers.org 00:00:06.51] Docker container a24196c7f41c created
[testcontainers.org 00:00:06.51] Start Docker container a24196c7f41c
[testcontainers.org 00:00:06.64] Wait for Docker container a24196c7f41c to complete readiness checks
[testcontainers.org 00:00:06.64] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container a24196c7f41c
[testcontainers.org 00:00:07.67] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container a24196c7f41c
[testcontainers.org 00:00:07.70] Docker container a24196c7f41c ready
[testcontainers.org 00:00:08.17] Delete Docker container a24196c7f41c
[testcontainers.org 00:00:08.42] Docker container 1fb1f5962747 created
[testcontainers.org 00:00:08.42] Start Docker container 1fb1f5962747
[testcontainers.org 00:00:08.54] Wait for Docker container 1fb1f5962747 to complete readiness checks
[testcontainers.org 00:00:08.54] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 1fb1f5962747
[testcontainers.org 00:00:09.56] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 1fb1f5962747
[testcontainers.org 00:00:09.59] Docker container 1fb1f5962747 ready
[testcontainers.org 00:00:09.83] Delete Docker container 1fb1f5962747
[testcontainers.org 00:00:10.06] Docker container 7065f1c8e2c8 created
[testcontainers.org 00:00:10.06] Start Docker container 7065f1c8e2c8
[testcontainers.org 00:00:10.18] Wait for Docker container 7065f1c8e2c8 to complete readiness checks
[testcontainers.org 00:00:10.18] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 7065f1c8e2c8
[testcontainers.org 00:00:11.21] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 7065f1c8e2c8
[testcontainers.org 00:00:11.24] Docker container 7065f1c8e2c8 ready
[testcontainers.org 00:00:11.46] Delete Docker container 7065f1c8e2c8
[testcontainers.org 00:00:11.69] Docker container d58c6d678172 created
[testcontainers.org 00:00:11.69] Start Docker container d58c6d678172
[testcontainers.org 00:00:11.81] Wait for Docker container d58c6d678172 to complete readiness checks
[testcontainers.org 00:00:11.81] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container d58c6d678172
[testcontainers.org 00:00:12.83] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container d58c6d678172
[testcontainers.org 00:00:12.87] Docker container d58c6d678172 ready
[testcontainers.org 00:00:13.29] Delete Docker container d58c6d678172
[testcontainers.org 00:00:13.53] Docker container 81902a8f2d18 created
[testcontainers.org 00:00:13.53] Start Docker container 81902a8f2d18
[testcontainers.org 00:00:13.65] Wait for Docker container 81902a8f2d18 to complete readiness checks
[testcontainers.org 00:00:13.66] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 81902a8f2d18
[testcontainers.org 00:00:14.68] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 81902a8f2d18
[testcontainers.org 00:00:14.72] Docker container 81902a8f2d18 ready
[testcontainers.org 00:00:15.05] Delete Docker container 81902a8f2d18
[testcontainers.org 00:00:15.27] Docker container bef6080bd615 created
[testcontainers.org 00:00:15.27] Start Docker container bef6080bd615
[testcontainers.org 00:00:15.39] Wait for Docker container bef6080bd615 to complete readiness checks
[testcontainers.org 00:00:15.39] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container bef6080bd615
[testcontainers.org 00:00:16.41] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container bef6080bd615
[testcontainers.org 00:00:16.44] Docker container bef6080bd615 ready
[testcontainers.org 00:00:16.78] Delete Docker container bef6080bd615
[testcontainers.org 00:00:17.00] Docker container d84be6bd1e9d created
[testcontainers.org 00:00:17.00] Start Docker container d84be6bd1e9d
[testcontainers.org 00:00:17.13] Wait for Docker container d84be6bd1e9d to complete readiness checks
[testcontainers.org 00:00:17.13] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container d84be6bd1e9d
[testcontainers.org 00:00:18.16] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container d84be6bd1e9d
[testcontainers.org 00:00:18.20] Docker container d84be6bd1e9d ready
[testcontainers.org 00:00:18.53] Delete Docker container d84be6bd1e9d
[testcontainers.org 00:00:18.77] Docker container 6c3065449bb6 created
[testcontainers.org 00:00:18.77] Start Docker container 6c3065449bb6
[testcontainers.org 00:00:18.90] Wait for Docker container 6c3065449bb6 to complete readiness checks
[testcontainers.org 00:00:18.90] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 6c3065449bb6
[testcontainers.org 00:00:19.92] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 6c3065449bb6
[testcontainers.org 00:00:19.95] Docker container 6c3065449bb6 ready
[testcontainers.org 00:00:20.28] Delete Docker container 6c3065449bb6
[testcontainers.org 00:00:20.50] Docker container 55a32531e0a0 created
[testcontainers.org 00:00:20.50] Start Docker container 55a32531e0a0
[testcontainers.org 00:00:20.62] Wait for Docker container 55a32531e0a0 to complete readiness checks
[testcontainers.org 00:00:20.62] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 55a32531e0a0
[testcontainers.org 00:00:21.66] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 55a32531e0a0
[testcontainers.org 00:00:21.69] Docker container 55a32531e0a0 ready
[testcontainers.org 00:00:21.85] Delete Docker container 55a32531e0a0
[testcontainers.org 00:00:22.07] Docker container 53496191e4f2 created
[testcontainers.org 00:00:22.08] Start Docker container 53496191e4f2
[testcontainers.org 00:00:22.19] Wait for Docker container 53496191e4f2 to complete readiness checks
[testcontainers.org 00:00:22.19] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 53496191e4f2
[testcontainers.org 00:00:23.22] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 53496191e4f2
[testcontainers.org 00:00:23.25] Docker container 53496191e4f2 ready
[testcontainers.org 00:00:23.45] Delete Docker container 53496191e4f2

Passed!  - Failed:     0, Passed:    12, Skipped:     0, Total:    12, Duration: 18 s - MetaObjects.IntegrationTests.dll (net8.0)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
B1: GET/POST/PATCH/PUT on generated routes under a strict SnakeCaseUpper (and KebabCaseUpper) host — PropertyNameCaseInsensitive=false, envelope key serialized as ROWS — returns no credential under an… ✅ pass live dotnet test MetaObjects.IntegrationTests --filter FullyQualifiedName~ApiContractCredentialHostVariantsTest — 12/12 passed, incl. (naming:plain, policy:snakeUpper), (naming:rename, policy:kebabUpper)…
B1 adversarial (fail-closed): a host whose serializer contract for the envelope cannot be read refuses the response instead of sending it unstripped ✅ pass live Same run: A_host_whose_contract_cannot_be_read_refuses_to_start_instead_of_leaking_the_account_credential and ..._the_subtype_credential both passed; StripBody's throw paths for a missing rows pro…
B2: a single narrowed EntityGenerator entry (Include = Order only, shared enum homed at Customer) emits C# that compiles on its own (no CS0234), while three entries of one run still declare the shared… ✅ pass live GeneratorIncludeTests.A_single_narrowed_entry_declares_a_shared_enum_whose_home_it_does_not_emit(listed:True/False) compiles the emitted files via Roslyn (PackageNamespaceTests.CompileErrors, 0 er…
L2/L6/L7 supporting findings: with a property rename beyond case the ?sort= allowlist accepts both the metadata field name and the resolved property (generated golden contract + live StripBody behavio… ✅ pass live PropertyNamingEmitSitesTests + SerializerKeysTests (25/25) and R6Plan2LoaderTests (15/15) — the sort-allowlist assertions run against the generator's emitted golden files (an intentional generat…
  • scripts/ci-local.sh --affected --strict-toolchains
  • Baseline (already run, passing at target commit): scripts/ci-local.sh --affected --strict-toolchains
  • B1 live: dotnet test server/csharp/MetaObjects.IntegrationTests --filter FullyQualifiedName~ApiContractCredentialHostVariantsTest — 12/12 passed (5+5 host-variant theories incl. plain/snakeUpper and rename/kebabUpper strict hosts, plus 2 fail-closed refusal tests) against Testcontainers Postgres over HTTP; containers removed afterwards
  • B2: dotnet test server/csharp/MetaObjects.Codegen.Tests --filter "FullyQualifiedName~GeneratorIncludeTests|FullyQualifiedName~PackageKeyedOutputTests" — 19/19 passed, incl. A_single_narrowed_entry_declares_a_shared_enum_whose_home_it_does_not_emit(listed:True/False) which compiles the emitted C# (Roslyn CompileErrors) and the three-entries-of-one-run exactly-once case
  • L2 + StripBody: dotnet test server/csharp/MetaObjects.Codegen.Tests --filter "FullyQualifiedName~PropertyNamingEmitSitesTests|FullyQualifiedName~SerializerKeysTests" — 25/25 passed (renamed sort allowlist maps field name and property name; StripBody under real JsonSerializerOptions incl. SnakeCaseUpper, and fail-closed on unreadable contract / non-array rows)
  • L6 + L7: dotnet test server/csharp/MetaObjects.Conformance.Tests --filter FullyQualifiedName~R6Plan2LoaderTests — 15/15 passed (self-referencing computed field → ERR_INVALID_ORIGIN; trailing-newline sized dbColumnType refused)
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed ✅
  • ⚠️ linter found issues (exit code 1)

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Push** - passed

✅ No issues found.

Validated by the no-mistakes gate in 1 run (the lint step regenerated one stale site-reference page).

…ny key spelling; declare a shared enum no sibling entry declares

B1: the credential-omitting result found the envelope's rows with env["rows"],
which a strict host (PropertyNameCaseInsensitive = false) misses when an
upper-case policy writes ROWS, so the rows went out unstripped. One helper,
SerializerKeys.StripBody, now serves the generated CredentialOmittingResult and
ReportExportHttp.Json: it reads the rows key from the envelope's own serializer
contract and refuses (throws) when the key or the array cannot be found.
SnakeCaseUpper and KebabCaseUpper strict-host variants join the live host test
and the SerializerKeys unit tests.

B2: a narrowed EntityGenerator entry skips a shared enum only when another
EntityGenerator entry of the same run accepts the enum's home; a single
narrowed entry declares it, so its output compiles on its own.

L1: origin.function, @union, @unionall, @Grain and @grainOrdinal carry
implementedIn ["typescript", "csharp"] (registry manifest, embeds and the
metamodel-docs fixture regenerated).
L2: with a rename beyond case, the C# sort allowlist accepts the field name
as well as the resolved property name.
L7: the C# sized @dbColumnType pattern ends at \z, so a trailing newline is
refused.
CHANGELOG: the credential entry names exactly what is stripped, the G2 and
sort entries match the new behaviour, and a computed field reading its own
name is listed as refused at load.
@dmealing
dmealing merged commit e96dc9c into main Nov 18, 2026
10 checks passed
@dmealing
dmealing deleted the fm/mo-rc19-review-blockers branch November 18, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant